#ifndef LIBSTATUS_H
#define LIBSTATUS_H

#include <QWidget>
#include <QProgressBar>
#include <QSlider>

#include "model/library.h"
#include "model/reader.h"
#include "model/writer.h"

class LibStatus : public QWidget
{
    Q_OBJECT

    QProgressBar* _bookCount;
    QProgressBar* _readerWriterCount;
    QProgressBar* _pendingCount;

    QSlider* _readInterval;
    QSlider* _writeInterval;
    QSlider* _maxBooksCount;
    QSlider* _readersCount;
    QSlider* _writersCount;

    Library _library;
    QVector<Reader*> _readers;
    QVector<Writer*> _writers;
public:
    explicit LibStatus(QWidget *parent = 0);
    
signals:
    
public slots:
    void setWaitCount(int waitCount);

private slots:
    void setReaderCount(int count);
    void setWriterCount(int count);

private:
    template<typename T>
    void changeWorkersCount(QVector<T*>& workers, int count);
};

#endif // LIBSTATUS_H
